#ifndef MPEGFILE_H

#define MPEGFILE_H

#include <afx.h>

#include <stdio.h>

class CMpegHeader
	{
public: // Konstanten
	enum {Mono=0, Stereo=1, JointStereo=2, DualChannel=3} ; // ChannelMode
	enum {EmphasisNo=0, Emphasis50_15=1, EmphasisCCITTj17=2} ; // Emphasis

private:
	DWORD HeaderData;
	long LastHeadFilePos;

private:
	void Build(const BYTE *b);

public:
	CMpegHeader();
	CMpegHeader(const BYTE *b);
	~CMpegHeader();
	bool Load(FILE *fp);
	bool LoadNext(FILE *fp);
	bool Load(CFile &file);
	bool LoadNext(CFile &file);
	const bool SyncOk();
	const int GetVersion();
	const int GetLayer();
	const bool GetErrorProtection();
	const long GetBitRate();
	const long GetSampleRate();
	const bool GetPadding();
	const bool GetPrivate();
	const int GetChannelMode();
	const long GetJointBoundFreq();
	const bool GetCopyright();
	const bool GetOriginal();
	const int GetEmphasis();
	const bool TypeComp(const CMpegHeader &h2);
	const long StdBlockSize();
	const long GetHeaderFilePos();
	const double GetLength(long Filelen);
	} ;

#endif


